<!-- HTML header for doxygen 1.8.8-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- For Mobile Devices -->
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
        <meta name="generator" content="Doxygen 1.8.17"/>
        <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
        <title>QuEST: Gates</title>
        <!--<link href="tabs.css" rel="stylesheet" type="text/css"/>-->
        <script type="text/javascript" src="dynsections.js"></script>
        <link href="doxygen.css" rel="stylesheet" type="text/css" />
        <link href="style.css" rel="stylesheet" type="text/css"/>
        <link href='https://fonts.googleapis.com/css?family=Roboto+Slab' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
        <link href="jquery.smartmenus.bootstrap.css" rel="stylesheet">
        <script type="text/javascript" src="jquery.smartmenus.js"></script>
        <!-- SmartMenus jQuery Bootstrap Addon -->
        <script type="text/javascript" src="jquery.smartmenus.bootstrap.js"></script>
        <!-- SmartMenus jQuery plugin -->
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="container">
                <div class="navbar-header">
                    <a class="navbar-brand"><img alt="Logo" src="logo.png"/></a>
                    <a class="navbar-brand"><b>QuEST</b> v3.2.0<br>The Quantum Exact Simulation Toolkit</a>
                </div>
            </div>
        </nav>
        <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
            <div class="content" id="content">
                <div class="container">
                    <div class="row">
                        <div class="col-sm-12 panel " style="padding-bottom: 15px;">
                            <div style="margin-bottom: 15px;">
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Gates</div>  </div>
</div><!--header-->
<div class="contents">

<p>Non-unitary but norm-preserving gates, such as measurements.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga34457f7f62ccd75fb7d3fe67cd2f815a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__normgate.html#ga34457f7f62ccd75fb7d3fe67cd2f815a">collapseToOutcome</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, int measureQubit, int outcome)</td></tr>
<tr class="memdesc:ga34457f7f62ccd75fb7d3fe67cd2f815a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates <code>qureg</code> to be consistent with measuring <code>measureQubit</code> in the given <code>outcome</code> (0 or 1), and returns the probability of such a measurement outcome.  <a href="group__normgate.html#ga34457f7f62ccd75fb7d3fe67cd2f815a">More...</a><br /></td></tr>
<tr class="separator:ga34457f7f62ccd75fb7d3fe67cd2f815a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2a3794103125f1e3cfa103f8b1963656"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__normgate.html#ga2a3794103125f1e3cfa103f8b1963656">measure</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, int measureQubit)</td></tr>
<tr class="memdesc:ga2a3794103125f1e3cfa103f8b1963656"><td class="mdescLeft">&#160;</td><td class="mdescRight">Measures a single qubit, collapsing it randomly to 0 or 1.  <a href="group__normgate.html#ga2a3794103125f1e3cfa103f8b1963656">More...</a><br /></td></tr>
<tr class="separator:ga2a3794103125f1e3cfa103f8b1963656"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae192ac0759e46c7b20a7182020155240"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__normgate.html#gae192ac0759e46c7b20a7182020155240">measureWithStats</a> (<a class="el" href="structQureg.html">Qureg</a> qureg, int measureQubit, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> *outcomeProb)</td></tr>
<tr class="memdesc:gae192ac0759e46c7b20a7182020155240"><td class="mdescLeft">&#160;</td><td class="mdescRight">Measures a single qubit, collapsing it randomly to 0 or 1, and additionally gives the probability of that outcome.  <a href="group__normgate.html#gae192ac0759e46c7b20a7182020155240">More...</a><br /></td></tr>
<tr class="separator:gae192ac0759e46c7b20a7182020155240"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Non-unitary but norm-preserving gates, such as measurements. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga34457f7f62ccd75fb7d3fe67cd2f815a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga34457f7f62ccd75fb7d3fe67cd2f815a">&#9670;&nbsp;</a></span>collapseToOutcome()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> collapseToOutcome </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>measureQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>outcome</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Updates <code>qureg</code> to be consistent with measuring <code>measureQubit</code> in the given <code>outcome</code> (0 or 1), and returns the probability of such a measurement outcome. </p>
<p>This is effectively performing a projection, or a measurement with a forced outcome. This is an irreversible change to the state, whereby computational states inconsistant with the outcome are given zero amplitude and the <code>qureg</code> is renormalised. Exits with error if the given outcome has a near zero probability, and so cannot be collapsed into.</p>
<p>Note that the collapse probably used for renormalisation is calculated for <code>outcome</code> <code>=</code> <code>0</code>, and assumed 1 minus this probability if <code>outcome</code> <code>=</code> <code>1</code>. Hence this routine will not correctly project un-normalised quregs onto <code>outcome</code> <code>=</code> <code>1</code>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">qureg</td><td>object representing the set of all qubits </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">measureQubit</td><td>qubit to measure </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">outcome</td><td>to force the measure qubit to enter </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>probability of the (forced) measurement outcome </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">invalidQuESTInputError</td><td>if <code>measureQubit</code> is outside [0, <code>qureg.numQubitsRepresented</code>), or if <code>outcome</code> is not in {0, 1}, or if the probability of <code>outcome</code> is zero (within machine epsilon) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown (state-vector) </dd>
<dd>
Tyson Jones (density matrix) </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST_8c_source.html#l00726">726</a> of file <a class="el" href="QuEST_8c_source.html">QuEST.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;                                                                    {</div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;    <a class="code" href="QuEST__validation_8c.html#ac31c45c5a31c523be0eb26abba6cf598">validateTarget</a>(qureg, measureQubit, __func__);</div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;    <a class="code" href="QuEST__validation_8c.html#ad613c75ff252a88e54f911053bd2032c">validateOutcome</a>(outcome, __func__);</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;    </div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> outcomeProb;</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;    <span class="keywordflow">if</span> (qureg.<a class="code" href="structQureg.html#acf78445e9435d09f44f0cc832c6aee79">isDensityMatrix</a>) {</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;        outcomeProb = <a class="code" href="QuEST__internal_8h.html#ae37b3eff5d3affbc1edfe216cabc1c53">densmatr_calcProbOfOutcome</a>(qureg, measureQubit, outcome);</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;        <a class="code" href="QuEST__validation_8c.html#a8accabb8a9d573c2ff80305841c3053d">validateMeasurementProb</a>(outcomeProb, __func__);</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;        <a class="code" href="QuEST__internal_8h.html#a5658f2ecbbd4ea425db5f7dc7fc4ba92">densmatr_collapseToKnownProbOutcome</a>(qureg, measureQubit, outcome, outcomeProb);</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;        outcomeProb = <a class="code" href="QuEST__internal_8h.html#a63cb88a5f4eb12fef087435b8db3f8eb">statevec_calcProbOfOutcome</a>(qureg, measureQubit, outcome);</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;        <a class="code" href="QuEST__validation_8c.html#a8accabb8a9d573c2ff80305841c3053d">validateMeasurementProb</a>(outcomeProb, __func__);</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;        <a class="code" href="QuEST__internal_8h.html#a008becc4a18f868340836e0ab9fd6df6">statevec_collapseToKnownProbOutcome</a>(qureg, measureQubit, outcome, outcomeProb);</div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;    }</div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;    </div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a0befde437a58ef8fe38495bfc2a16f0e">qasm_recordMeasurement</a>(qureg, measureQubit);</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;    <span class="keywordflow">return</span> outcomeProb;</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__cpu__distributed_8c_source.html#l01276">densmatr_calcProbOfOutcome()</a>, <a class="el" href="QuEST__cpu_8c_source.html#l00785">densmatr_collapseToKnownProbOutcome()</a>, <a class="el" href="QuEST_8h_source.html#l00206">Qureg::isDensityMatrix</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00398">qasm_recordMeasurement()</a>, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>, <a class="el" href="QuEST__cpu__distributed_8c_source.html#l01260">statevec_calcProbOfOutcome()</a>, <a class="el" href="QuEST__cpu__distributed_8c_source.html#l01298">statevec_collapseToKnownProbOutcome()</a>, <a class="el" href="QuEST__validation_8c_source.html#l00491">validateMeasurementProb()</a>, <a class="el" href="QuEST__validation_8c_source.html#l00487">validateOutcome()</a>, and <a class="el" href="QuEST__validation_8c_source.html#l00364">validateTarget()</a>.</p>

<p class="reference">Referenced by <a class="el" href="test__gates_8cpp_source.html#l00015">TEST_CASE()</a>.</p>

</div>
</div>
<a id="ga2a3794103125f1e3cfa103f8b1963656"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2a3794103125f1e3cfa103f8b1963656">&#9670;&nbsp;</a></span>measure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int measure </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>measureQubit</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Measures a single qubit, collapsing it randomly to 0 or 1. </p>
<p>Outcome probabilities are weighted by the state vector, which is irreversibly changed after collapse to be consistent with the outcome.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">qureg</td><td>object representing the set of all qubits </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">measureQubit</td><td>qubit to measure </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the measurement outcome, 0 or 1 </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">invalidQuESTInputError</td><td>if <code>measureQubit</code> is outside [0, <code>qureg.numQubitsRepresented</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown (state-vector) </dd>
<dd>
Tyson Jones (density matrix) </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST_8c_source.html#l00758">758</a> of file <a class="el" href="QuEST_8c_source.html">QuEST.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;                                           {</div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;    <a class="code" href="QuEST__validation_8c.html#ac31c45c5a31c523be0eb26abba6cf598">validateTarget</a>(qureg, measureQubit, __func__);</div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;    </div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;    <span class="keywordtype">int</span> outcome;</div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;    <a class="code" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> discardedProb;</div>
<div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;    <span class="keywordflow">if</span> (qureg.<a class="code" href="structQureg.html#acf78445e9435d09f44f0cc832c6aee79">isDensityMatrix</a>)</div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;        outcome = <a class="code" href="QuEST__common_8c.html#ae4ebc1f4dd48922bfb30ad1692310269">densmatr_measureWithStats</a>(qureg, measureQubit, &amp;discardedProb);</div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;        outcome = <a class="code" href="QuEST__common_8c.html#ac2eb81c71d0e0fbec7be5b45b1db1448">statevec_measureWithStats</a>(qureg, measureQubit, &amp;discardedProb);</div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;    </div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a0befde437a58ef8fe38495bfc2a16f0e">qasm_recordMeasurement</a>(qureg, measureQubit);</div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;    <span class="keywordflow">return</span> outcome;</div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__common_8c_source.html#l00369">densmatr_measureWithStats()</a>, <a class="el" href="QuEST_8h_source.html#l00206">Qureg::isDensityMatrix</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00398">qasm_recordMeasurement()</a>, <a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a>, <a class="el" href="QuEST__common_8c_source.html#l00361">statevec_measureWithStats()</a>, and <a class="el" href="QuEST__validation_8c_source.html#l00364">validateTarget()</a>.</p>

<p class="reference">Referenced by <a class="el" href="test__gates_8cpp_source.html#l00121">TEST_CASE()</a>.</p>

</div>
</div>
<a id="gae192ac0759e46c7b20a7182020155240"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae192ac0759e46c7b20a7182020155240">&#9670;&nbsp;</a></span>measureWithStats()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int measureWithStats </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structQureg.html">Qureg</a>&#160;</td>
          <td class="paramname"><em>qureg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>measureQubit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a> *&#160;</td>
          <td class="paramname"><em>outcomeProb</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Measures a single qubit, collapsing it randomly to 0 or 1, and additionally gives the probability of that outcome. </p>
<p>Outcome probabilities are weighted by the state vector, which is irreversibly changed after collapse to be consistent with the outcome.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">qureg</td><td>object representing the set of all qubits </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">measureQubit</td><td>qubit to measure </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">outcomeProb</td><td>a pointer to a qreal which is set to the probability of the occurred outcome </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the measurement outcome, 0 or 1 </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">invalidQuESTInputError</td><td>if <code>measureQubit</code> is outside [0, <code>qureg.numQubitsRepresented</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Ania Brown (state-vector) </dd>
<dd>
Tyson Jones (density matrix) </dd></dl>

<p class="definition">Definition at line <a class="el" href="QuEST_8c_source.html#l00745">745</a> of file <a class="el" href="QuEST_8c_source.html">QuEST.c</a>.</p>
<div class="fragment"><div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;                                                                        {</div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;    <a class="code" href="QuEST__validation_8c.html#ac31c45c5a31c523be0eb26abba6cf598">validateTarget</a>(qureg, measureQubit, __func__);</div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160; </div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;    <span class="keywordtype">int</span> outcome;</div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;    <span class="keywordflow">if</span> (qureg.<a class="code" href="structQureg.html#acf78445e9435d09f44f0cc832c6aee79">isDensityMatrix</a>)</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;        outcome = <a class="code" href="QuEST__common_8c.html#ae4ebc1f4dd48922bfb30ad1692310269">densmatr_measureWithStats</a>(qureg, measureQubit, outcomeProb);</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;        outcome = <a class="code" href="QuEST__common_8c.html#ac2eb81c71d0e0fbec7be5b45b1db1448">statevec_measureWithStats</a>(qureg, measureQubit, outcomeProb);</div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;    </div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;    <a class="code" href="QuEST__qasm_8c.html#a0befde437a58ef8fe38495bfc2a16f0e">qasm_recordMeasurement</a>(qureg, measureQubit);</div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;    <span class="keywordflow">return</span> outcome;</div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;}</div>
</div><!-- fragment -->
<p class="reference">References <a class="el" href="QuEST__common_8c_source.html#l00369">densmatr_measureWithStats()</a>, <a class="el" href="QuEST_8h_source.html#l00206">Qureg::isDensityMatrix</a>, <a class="el" href="QuEST__qasm_8c_source.html#l00398">qasm_recordMeasurement()</a>, <a class="el" href="QuEST__common_8c_source.html#l00361">statevec_measureWithStats()</a>, and <a class="el" href="QuEST__validation_8c_source.html#l00364">validateTarget()</a>.</p>

<p class="reference">Referenced by <a class="el" href="test__gates_8cpp_source.html#l00213">TEST_CASE()</a>.</p>

</div>
</div>
</div><!-- contents -->
<div class="ttc" id="aQuEST__validation_8c_html_a8accabb8a9d573c2ff80305841c3053d"><div class="ttname"><a href="QuEST__validation_8c.html#a8accabb8a9d573c2ff80305841c3053d">validateMeasurementProb</a></div><div class="ttdeci">void validateMeasurementProb(qreal prob, const char *caller)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__validation_8c_source.html#l00491">QuEST_validation.c:491</a></div></div>
<div class="ttc" id="aQuEST__validation_8c_html_ac31c45c5a31c523be0eb26abba6cf598"><div class="ttname"><a href="QuEST__validation_8c.html#ac31c45c5a31c523be0eb26abba6cf598">validateTarget</a></div><div class="ttdeci">void validateTarget(Qureg qureg, int targetQubit, const char *caller)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__validation_8c_source.html#l00364">QuEST_validation.c:364</a></div></div>
<div class="ttc" id="aQuEST__validation_8c_html_ad613c75ff252a88e54f911053bd2032c"><div class="ttname"><a href="QuEST__validation_8c.html#ad613c75ff252a88e54f911053bd2032c">validateOutcome</a></div><div class="ttdeci">void validateOutcome(int outcome, const char *caller)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__validation_8c_source.html#l00487">QuEST_validation.c:487</a></div></div>
<div class="ttc" id="aQuEST__internal_8h_html_a63cb88a5f4eb12fef087435b8db3f8eb"><div class="ttname"><a href="QuEST__internal_8h.html#a63cb88a5f4eb12fef087435b8db3f8eb">statevec_calcProbOfOutcome</a></div><div class="ttdeci">qreal statevec_calcProbOfOutcome(Qureg qureg, int measureQubit, int outcome)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu__distributed_8c_source.html#l01260">QuEST_cpu_distributed.c:1260</a></div></div>
<div class="ttc" id="agroup__type_html_ga7740e349b4f8bae6451547680f0ce2d6"><div class="ttname"><a href="group__type.html#ga7740e349b4f8bae6451547680f0ce2d6">qreal</a></div><div class="ttdeci">#define qreal</div></div>
<div class="ttc" id="aQuEST__internal_8h_html_a5658f2ecbbd4ea425db5f7dc7fc4ba92"><div class="ttname"><a href="QuEST__internal_8h.html#a5658f2ecbbd4ea425db5f7dc7fc4ba92">densmatr_collapseToKnownProbOutcome</a></div><div class="ttdeci">void densmatr_collapseToKnownProbOutcome(Qureg qureg, int measureQubit, int outcome, qreal outcomeProb)</div><div class="ttdoc">Renorms (/prob) every | * outcome * &gt;&lt; * outcome * | state, setting all others to zero.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu_8c_source.html#l00785">QuEST_cpu.c:785</a></div></div>
<div class="ttc" id="aQuEST__qasm_8c_html_a0befde437a58ef8fe38495bfc2a16f0e"><div class="ttname"><a href="QuEST__qasm_8c.html#a0befde437a58ef8fe38495bfc2a16f0e">qasm_recordMeasurement</a></div><div class="ttdeci">void qasm_recordMeasurement(Qureg qureg, int measureQubit)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__qasm_8c_source.html#l00398">QuEST_qasm.c:398</a></div></div>
<div class="ttc" id="aQuEST__internal_8h_html_a008becc4a18f868340836e0ab9fd6df6"><div class="ttname"><a href="QuEST__internal_8h.html#a008becc4a18f868340836e0ab9fd6df6">statevec_collapseToKnownProbOutcome</a></div><div class="ttdeci">void statevec_collapseToKnownProbOutcome(Qureg qureg, int measureQubit, int outcome, qreal outcomeProb)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu__distributed_8c_source.html#l01298">QuEST_cpu_distributed.c:1298</a></div></div>
<div class="ttc" id="aQuEST__common_8c_html_ac2eb81c71d0e0fbec7be5b45b1db1448"><div class="ttname"><a href="QuEST__common_8c.html#ac2eb81c71d0e0fbec7be5b45b1db1448">statevec_measureWithStats</a></div><div class="ttdeci">int statevec_measureWithStats(Qureg qureg, int measureQubit, qreal *outcomeProb)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__common_8c_source.html#l00361">QuEST_common.c:361</a></div></div>
<div class="ttc" id="astructQureg_html_acf78445e9435d09f44f0cc832c6aee79"><div class="ttname"><a href="structQureg.html#acf78445e9435d09f44f0cc832c6aee79">Qureg::isDensityMatrix</a></div><div class="ttdeci">int isDensityMatrix</div><div class="ttdoc">Whether this instance is a density-state representation.</div><div class="ttdef"><b>Definition:</b> <a href="QuEST_8h_source.html#l00206">QuEST.h:206</a></div></div>
<div class="ttc" id="aQuEST__internal_8h_html_ae37b3eff5d3affbc1edfe216cabc1c53"><div class="ttname"><a href="QuEST__internal_8h.html#ae37b3eff5d3affbc1edfe216cabc1c53">densmatr_calcProbOfOutcome</a></div><div class="ttdeci">qreal densmatr_calcProbOfOutcome(Qureg qureg, int measureQubit, int outcome)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__cpu__distributed_8c_source.html#l01276">QuEST_cpu_distributed.c:1276</a></div></div>
<div class="ttc" id="aQuEST__common_8c_html_ae4ebc1f4dd48922bfb30ad1692310269"><div class="ttname"><a href="QuEST__common_8c.html#ae4ebc1f4dd48922bfb30ad1692310269">densmatr_measureWithStats</a></div><div class="ttdeci">int densmatr_measureWithStats(Qureg qureg, int measureQubit, qreal *outcomeProb)</div><div class="ttdef"><b>Definition:</b> <a href="QuEST__common_8c_source.html#l00369">QuEST_common.c:369</a></div></div>
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
</div>
</div>
</div>
</div>
</div>
</body>
        <script type="text/javascript" src="boot.js"></script>
</html>
